import vue from '@vitejs/plugin-vue'
import {defineConfig} from 'vite'
import path from "path"

export default defineConfig({
    base: './',
    // envPrefix: "VUE_APP_",
    plugins: [vue()],
    optimizeDeps: {
        include: ['schart.js']
    },
    server: {
        // 反向代理（跨域处理）
        // proxy: {
        //     '/api': {
        //         target: 'https://api.nnlxgj.com/admin',
        //         changeOrigin: true,
        //         rewrite: (path) => path.replace(/^\/api/, '')
        //     },
        // },
    },
    resolve: {
        alias: [
            {
                find: "@",
                replacement: path.resolve(__dirname, "./src"),
            }
        ],
    },
    css: {
        preprocessorOptions: {
            scss: {
                additionalData: `@import "@/styles/index.scss";`
            }
        }
    }
})
